package gui;

import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JTextArea;
import java.awt.SystemColor;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class ExtendTaskDuration extends JPanel{
	String pid;
	String request;
	SignificationAssessment significtionAssessment;
	AcademicFrame frame;
	JPanel panel; // JPanel for reuse of code
	private JTextField daysTextField;
	
	public ExtendTaskDuration(AcademicFrame frame,JPanel panel, String pid,String request) {
		super();
		this.pid=pid;
		this.request=request;
		this.frame=frame;
		this.panel=panel;
		frame.setSize(500, 500);
		initialize();
	}
	
	private void initialize() {
		setLayout(null);
		
		JLabel lblDurationForTask = new JLabel("Duration For Task Extension");
		lblDurationForTask.setBounds(10, 11, 430, 34);
		lblDurationForTask.setFont(new Font("Tahoma", Font.BOLD, 28));
		add(lblDurationForTask);
		
		JLabel lblSetNumberOf = new JLabel("Set number of days for completing the task");
		lblSetNumberOf.setBounds(10, 87, 291, 14);
		add(lblSetNumberOf);
		
		JLabel label_1 = new JLabel("__________________________________________________________________");
		label_1.setBounds(10, 42, 430, 14);
		add(label_1);
		
		daysTextField = new JTextField();
		daysTextField.setBounds(228, 84, 86, 20);
		add(daysTextField);
		daysTextField.setColumns(10);
		
		JButton btnSend = new JButton("Cancel");
		btnSend.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				frame.setSize(500, 500);
				frame.setContentPane(panel); //in case of extendAssessDuration go back to significationAssessment
			}
		});
		btnSend.setBounds(10, 236, 89, 23);
		add(btnSend);
		
		JTextArea txtrAddReasoningFor = new JTextArea();
		txtrAddReasoningFor.setForeground(SystemColor.windowBorder);
		txtrAddReasoningFor.setFont(new Font("Courier New", Font.PLAIN, 15));
		txtrAddReasoningFor.setText("Add Reasoning for the extension request...");
		txtrAddReasoningFor.setBounds(10, 112, 430, 114);
		add(txtrAddReasoningFor);
		
		JButton btnNewButton = new JButton("Send");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				String days= daysTextField.getText();
				
				
			}
		});
		btnNewButton.setBounds(351, 236, 89, 23);
		add(btnNewButton);
	}
}
